<?php

echo("<TR><TD>");
			echo("<TABLE border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\"><FORM name=\"form\" action=\"formaction.php\" method=\"post\" enctype=\"multipart/form-data\" onKeyPress=\"swallowEnter()\"> \n
					<TR class=\"even\"><TD class=\"formDescriptiveText\" width=\"30%\">Underwriter:</TD> <TD width=\"70%\" class=\"formElementTextLeft\"> \n");
						//#####################################
						// VERIFY - Underwriter 
						//#####################################
						echo "&nbsp;<B>" . $_SESSION['keepUW'] . "</B>&nbsp;</TD></TR> \n \n";	
						echo ("<INPUT name=\"underwriter\" type=\"hidden\" value=\"". $_SESSION['keepUW'] . "\"> \n");
						echo ("<INPUT name=\"abbreviation\" type=\"hidden\" value=\"" . $_SESSION['name'] . "\"> \n");
						//#####################################
						// VERIFY - Start Date
						//#####################################
					    echo("<TR class=\"odd\"><TD class=\"formDescriptiveText\">Start Date:</TD>  <TD class=\"formElementTextLeft\">\n");
						echo "&nbsp;<B>" . $_SESSION['startMonth'] . " / " . $_SESSION['startDay'] . " / " . $_SESSION['startYear'] . "</B> \n";	
						echo ("<INPUT name=\"startMonth\" type=\"hidden\" value=\"" . $_SESSION['startMonth'] . "\"> \n");
						echo ("<INPUT name=\"startDay\" type=\"hidden\" value=\"" . $_SESSION['startDay'] . "\"> \n");
						echo ("<INPUT name=\"startYear\" type=\"hidden\" value=\"" . $_SESSION['startYear'] . "\"> \n");
					    echo("</TD></TR> \n \n");	
						//#####################################
						//VERIFY - End Date						
						//#####################################
					    echo("<TR class=\"even\"><TD class=\"formDescriptiveText\">End Date:</TD>  <TD class=\"formElementTextLeft\">\n");
						echo "&nbsp;<B>" . $_SESSION['endMonth'] . " / " . $_SESSION['endDay'] . " / " . $_SESSION['endYear'] . "</B>\n";	
						echo ("<INPUT name=\"endMonth\" type=\"hidden\" value=\"" . $_SESSION['endMonth'] . "\"> \n");
						echo ("<INPUT name=\"endDay\" type=\"hidden\" value=\"" . $_SESSION['endDay'] . "\"> \n");
						echo ("<INPUT name=\"endYear\" type=\"hidden\" value=\"" . $_SESSION['endYear'] . "\"> \n");
						echo("</TD></TR> \n \n");	
						//#####################################
						//VERIFY - Length						
						//#####################################				
					    echo("<TR class=\"odd\"><TD class=\"formDescriptiveText\">Spot Length:</TD>  <TD class=\"formElementTextLeft\">\n");
						echo "&nbsp;<B>" . $_SESSION['length'] . " Seconds" . "</B> \n";	
						echo ("<INPUT name=\"length\" type=\"hidden\" value=\"" . $_SESSION['length'] . "\"> \n");
					    echo("</TD></TR> \n \n");		
						//#####################################
						//VERIFY - ID/AV# 						
						//#####################################				
					    echo("<TR class=\"even\"><TD class=\"formDescriptiveText\">Spot ID:</TD>  <TD class=\"formElementTextLeft\">\n");
						echo "&nbsp;<B>" . $_SESSION['spotID'] . "</B> \n";	
						echo ("<INPUT name=\"spotID\" type=\"hidden\" value=\"" . $_SESSION['spotID'] . "\"> \n");
					    echo("</TD></TR> \n \n");	
						
						//#####################################
						//VERIFY - TYPE: EPSA or UW 						
						//#####################################				
					    echo("<TR class=\"odd\"><TD class=\"formDescriptiveText\">Type:</TD>  <TD class=\"formElementTextLeft\">\n");
						if($_SESSION['type'] == 'UW'){
						echo "&nbsp;<B>Underwriter</B> \n";	
						}else{
						echo "&nbsp;<B>EPSA</B> \n";	
						}
						echo ("<INPUT name=\"type\" type=\"hidden\" value=\"" . $_SESSION['type'] . "\"> \n");
					    echo("</TD></TR> \n \n");	
						

		//BEGIN ENTER MULTIPLE FIELDS FOR VERIFY
		$numFieldsToCreate = $_SESSION['mulitpleHighNumber'];
		if(!$numFieldsToCreate){
		$numFieldsToCreate = 1;
		}
			$i = 0;
			$q = 1;
			while ($i < $numFieldsToCreate){
			//+++++++++++++++++++++++++++++++++++++
			//BEGIN REPEATING FIELDS FOR MULTIPLE ENTRIES
			//+++++++++++++++++++++++++++++++++++++
					    echo("<TR class=\"blockHeader\"><TD valign=\"top\" align=\"right\">ENTRY NUMBER $q:</TD>  <TD valign=\"top\" align=\"right\"> \n");
						$time = $_SESSION['verifyTimeArray']["$i"];
						$hour = substr($time, 0, 2);
						$minute = substr($time, 3, 2);
						$ampm = substr($time, 6, 2);
						
							//++++++++++++++++++++++++++++++++++++++++
							//Also used in FORM ITEM - Air Time Below
							$plannerHour = substr($_SESSION['plannerEntry'][$i]["military"],0,2);
							$plannerMinute = substr($_SESSION['plannerEntry'][$i]["military"],3,2);
							$plannerSeconds =substr($_SESSION['plannerEntry'][$i]["military"],6,2);
							if($plannerHour < '12'){
							$plannerAMPM = 'AM';
							}else{
							$plannerAMPM = 'PM';
							}
							
							$displayHour = date("h", mktime ($plannerHour,$plannerMinute,$plannerSeconds));
							
							//END++++++++++++++++++++++++++++++++++						
						
						
						if(count($_SESSION['displayConflicts']) > '0'){
							$searchCriteria = "$plannerHour:$plannerMinute:$plannerSeconds:$plannerAMPM";
							if(array_search($searchCriteria,$_SESSION['displayConflicts']) !== FALSE){
									echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><TR><TD width=\"20\" align=\"left\"><IMG src=\"$imagesDirectory/warning2.gif\" border=\"0\" width=\"18\" height=\"18\"> </TD><TD align=\"left\" class=\"conflictWarning\" nowrap> Scheduling Conflict</TD></TR></TABLE>";
							}
						}
						
						
						echo("</TD></TR> \n \n");	
						//#####################################
						//VERIFY - Air Time 						
						//#####################################				
					    echo("<TR class=\"even\"><TD class=\"formDescriptiveText\">Air Time:</TD>  <TD class=\"formElementTextLeft\">\n");
						echo "&nbsp;<B>$displayHour:$plannerMinute:$plannerSeconds $plannerAMPM</B> \n";	
						echo ("<INPUT name=\"hour$q\" type=\"hidden\" value=\"$displayHour\"> \n");
						echo ("<INPUT name=\"minute$q\" type=\"hidden\" value=\"$plannerMinute\"> \n");
						echo ("<INPUT name=\"seconds$q\" type=\"hidden\" value=\"$plannerSeconds\"> \n");
						echo ("<INPUT name=\"ampm$q\" type=\"hidden\" value=\"$plannerAMPM\"> \n");
					    echo("</TD></TR> \n \n");	
						//#####################################
						//VERIFY - Days of Week 						
						//#####################################				
					    echo("<TR class=\"odd\"><TD class=\"formDescriptiveText\">Day(s) of week:</TD>  <TD class=\"formElementTextLeft\">\n");
						if(array_search("mon",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Mon</B> &nbsp; \n";	
						echo ("<INPUT name=\"mon$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("tue",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Tue</B> &nbsp; \n";	
						echo ("<INPUT name=\"tue$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("wed",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Wed</B> &nbsp; \n";	
						echo ("<INPUT name=\"wed$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("thu",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Thu</B> &nbsp; \n";	
						echo ("<INPUT name=\"thu$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("fri",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Fri</B> &nbsp; \n";	
						echo ("<INPUT name=\"fri$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("sat",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Sat</B> &nbsp; \n";	
						echo ("<INPUT name=\"sat$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						if(array_search("sun",$_SESSION['plannerEntry'][$i][days]) !== FALSE){
						echo "&nbsp;<B>Sun</B> &nbsp; \n";	
						echo ("<INPUT name=\"sun$q\" type=\"hidden\" value=\"true\"> \n");
					    }
						echo("</TD></TR> \n \n");	
		
						//#####################################
						//VERIFY - Rate 						
						//#####################################				
					    echo("<TR class=\"even\"><TD class=\"formDescriptiveText\">Rate:</TD>  <TD class=\"formElementTextLeft\">\n");
						if($_SESSION['plannerEntry'][$i][rate] == ""){
						echo "&nbsp;<B>NA</B> \n";	
						$myRate = 'NA';
						}else{
						echo "&nbsp;<B>$" . $_SESSION['plannerEntry'][$i][rate] . "</B> \n";	
						$myRate = $_SESSION['plannerEntry'][$i][rate];
						}
						echo ("<INPUT name=\"rate$q\" type=\"hidden\" value=\"$myRate\"> \n");
					    echo("</TD></TR> \n \n");						
						//#####################################
						//VERIFY - Live Read 						
						//#####################################				
					    echo("<TR class=\"odd\"><TD class=\"formDescriptiveText\">Is this spot a live read?</TD>  <TD class=\"formElementTextLeft\">\n");
						if($_SESSION['plannerEntry'][$i][live] == 'true'){
						echo "&nbsp;<B>Yes</B> \n";	
						}else{
						echo "&nbsp;<B>No</B> \n";	
						}
						echo ("<INPUT name=\"live$q\" type=\"hidden\" value=\"" . $_SESSION['plannerEntry'][$i][live] . "\"> \n");
					    echo("</TD></TR> \n \n");						
						//#####################################
						//VERIFY - TRADE? 						
						//#####################################	
					    echo("<TR class=\"even\"><TD class=\"formDescriptiveText\">Is this spot a trade?</TD>  <TD class=\"formElementTextLeft\">\n");
						if($_SESSION['plannerEntry'][$i][trade] == 'true'){
						echo "&nbsp;<B>Yes</B> \n";	
						}else{
						echo "&nbsp;<B>No</B> \n";	
						}
						echo ("<INPUT name=\"trade$q\" type=\"hidden\" value=\"" . $_SESSION['plannerEntry'][$i][trade] . "\"> \n");
					    echo("</TD></TR> \n \n");		
			//+++++++++++++++++++++++++++++++++++++
			//END REPEATING FIELDS FOR MULTIPLE ENTRIES
			//+++++++++++++++++++++++++++++++++++++												
			++$i;
			++$q;
			}
		

		echo "</TABLE>";
			if($_SESSION['PlannerStamp']){
			echo"<INPUT name=\"PlannerStamp\" type=\"hidden\" value=\"".$_SESSION['PlannerStamp']."\">";
			}

			echo("<TR><TD valign=\"middle\" align=\"center\" bgcolor=\"#666666\"><INPUT name=\"highNumber\" type=\"hidden\" value=\"$numFieldsToCreate\"><TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><TR><TD><INPUT name=\"action\" type=\"hidden\" value=\"enterGrid\">");
			
			$dateConflict = strpos($_SESSION['message'],"WARNING:");//if the end date is before the start date disable submit button
			
			if(count($_SESSION['displayConflicts']) > '0' || $dateConflict){// strpos($readfile, "Currently:")--------------------------
				echo("<INPUT name=\"Submit\" type=\"submit\" class=\"inputButton\"  value=\"Confirm\" disabled=\"true\">");
			}else{
				echo("<INPUT name=\"Submit\" type=\"submit\" class=\"inputButton\"  value=\"Confirm\">");
			}
			echo ("</TD></FORM> \n <FORM action=\"index.php?ID=0&amp;subMenu=2&amp;action=enter\" method=\"post\" enctype=\"multipart/form-data\"> \n");
			 //Hidden values for Change Button
			echo("<!--FORM DATA FOR MAKING CHANGES--> \n");
			echo ("<INPUT name=\"startMonth\" type=\"hidden\" value=\"" . $_SESSION['startMonth'] . "\"> \n");
			echo ("<INPUT name=\"startDay\" type=\"hidden\" value=\"" . $_SESSION['startDay'] . "\"> \n");
			echo ("<INPUT name=\"startYear\" type=\"hidden\" value=\"" . $_SESSION['startYear'] . "\"> \n");			
			if($_SESSION['PlannerStamp']){
			echo"<INPUT name=\"PlannerStamp\" type=\"hidden\" value=\"".$_SESSION['PlannerStamp']."\">\n";
			}
			
			echo("<TD> &nbsp; &nbsp; &nbsp; <INPUT name=\"Reset\" type=\"submit\" class=\"inputButton\"  value=\"Change\"></TD></FORM></TR></TABLE> </TD></TR>");
			echo("</TABLE>");			

?>